<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Toggle Class</title>
	<link rel="stylesheet" type="text/css" href="../css/jQuery.css"/>
</head>
<body>
	<input id="toggleButton" type="button" value="Toggle Class" class="warning"/>
	<div id="target" style="overflow: scroll; width: 200px; height: 100px;">
	  Lorem ipsum dolor sit amet, consectetur adipisicing elit,
	  sed do eiusmod tempor incididunt ut labore et dolore magna
	  aliqua. Ut enim ad minim veniam, quis nostrud exercitation
	  ullamco laboris nisi ut aliquip ex ea commodo consequat.
	  Duis aute irure dolor in reprehenderit in voluptate velit
	  esse cillum dolore eu fugiat nulla pariatur. Excepteur
	  sint occaecat cupidatat non proident, sunt in culpa qui
	  officia deserunt mollit anim id est laborum.
	</div>
	<div id="other">
	  Trigger the handler
	</div>
	<div id="log"></div>
	<script type="text/javascript" src="../js/jquery-1.10.2.js"></script>
	<script type="text/javascript">
		$('#toggleButton').click(function() {
			$(this).toggleClass('warning error');
		});
		//$('#target').scroll(function() {
		//	$('#log').append('<div>Handler for .scroll() called.</div>');
		//});
		$(window).on('scroll', '#target', function() {
			$('#log').append('<div>Handler for .scroll() called.</div>');
		});
	</script>
</body>
</html>